<div ng-controller="taskscontroller">
	<img ng-show="loadingTasks" style="width:25px;height:25px" alt="{{ Main_Loading }}" src="Resources/Pictures/ajax-loader.gif" />
	<div class="widget-box" id="recent-box" ng-hide="loadingTasks">
		<div class="widget-header header-color-blue">
			<div class="row">
				<div class="col-sm-3">
					<button ng-click="addNewClicked=!addNewClicked;" class="btn btn-sm btn-danger header-elements-margin"><i class="glyphicon  glyphicon-plus"></i>{{ Tasks_AddTask }}</button>
				</div>
				<div class="col-sm-3">
					<input type="text" ng-model="filterTask" class="form-control search header-elements-margin" placeholder="{{ Main_Filter }}">
				</div>
			</div>
		</div>
		<div class="widget-body ">
			<form ng-show="addNewClicked" ng-init="addNewClicked=false;" ng-if="addNewClicked" id="newTaskForm" class="add-task">
				<div class="form-actions">
					<div class="row form-group">
						<div class="col-xs-6">
							<input type="text" class="form-control" name="comment" ng-model="taskInput" placeholder="Nom de la tâche" ng-focus="addNewClicked" />
						</div>
						<div class="col-xs-4">
							<select class="form-control" data-ng-options="user.Id as user.Firstname + ' ' + user.Lastname for user in users" data-ng-model="assigneeUser"></select>
						</div>
						<button class="btn btn-default" type="submit" ng-click="addTaskCommand(taskInput)"><i class="glyphicon glyphicon-plus"></i>{{ Main_Add }}</button>
					</div>
				</div>
			</form>
			<img ng-show="loadingTasks" style="width:25px;height:25px" alt="{{ Main_Loading }}" src="Resources/Pictures/ajax-loader.gif" />
			<div class="task" ng-show="!loadingTasks">
				<label class="checkbox" ng-repeat="task in tasks | filter : filterTask">
				<input 
				type="checkbox"
				value="{{task.State}}"
				ng-checked="task.State==1"
				ng-click="updateStatusCommand(task.Id,task.State, task.Name)"/> 
				<span ng-class="{strike:task.State==1}">{{task.Name}} [{{task.Id}}]</span>
				<a ng-click="deleteTaskCommand(task.Id)" class="pull-right"><i class="glyphicon glyphicon-trash"></i></a>
				</label>
			</div>
		</div>
	</div>
</div>